//当前这个模块，API进行统一管理、
import request from './request'


//获取全部商品
export const reqGetAllGoods = (data) => {
    //发请求:axios发请求返回结果Promise对象
    return request({ url: '/api/getAllGoods', data,method: 'post' }) 
}

//获取上台商品分类
export const reqGetCateGoryList = () => {
    //发请求:axios发请求返回结果Promise对象
    return request({ url: '/api/getCateGoryList', method: 'get' }) 
}
//根据商品id获得商品信息
export const reqGetGoodsInfoById = (id) => {
    //发请求:axios发请求返回结果Promise对象
    return request({ url: `/api/getGoodsById/${id}`, method: 'get' }) 
}
//上架商品接口
export const reqSaleGoods = (data) => {
    return request({ url: `api/saleGoods`, data, method: 'post' })
}
//下架商品接口
export const reqCancelGoods = (data) => {
    return request({ url: `api/cancelGoods`, data,method: 'post' })
}
//删除商品接口
export const reqDeleteGoods = (id) => {
    return request({ url: `api/deleteGoods/${id}`, method: 'DELETE' })
}

//上传图片接口
export const reqUpLoadImg = (data) => {
    return request({ url: `api/uploadImg`,data, method: 'post' })
}
//添加商品接口
export const reqAddGoods = (data) => {
    return request({ url: `api/addGoods`,data, method: 'post' })
}
//更新商品接口
export const reqUpdateGoods = (data) => {
    return request({ url: `api/updateGoods`,data, method: 'post' })
}
//获取用户列表
export const reqGetUserList = (data) => {
    return request({ url: `api/getUserList`,data, method: 'post' })
}
//删除用户
export const reqDeleteUser = (id) => {
    return request({ url: `api/deleteUser/${id}`, method: 'delete' })
}
//修改用户封禁状态
export const reqChangeUserBan = (data) => {
    return request({ url: `api/changeUserBan`,data, method: 'post' })
}
//添加或修改分类状态
export const reqAddOrUpdateCategory = (data) => {
    return request({ url: `api/addOrUpdateCategory`,data, method: 'post' })
}
// api/deleteCategory/10218
//删除分类接口
export const reqDeleteCategory = (categoryId) => {
    return request({ url: `api/deleteCategory/${categoryId}`, method: 'DELETE' })
}
// updateCategoryIsDelete
//更新分类上架状态接口
export const reqUpdateCategoryIsDelete = (data) => {
    return request({ url: `api/updateCategoryIsDelete`,data, method: 'post' })
}
// 
//获取全部商品分类
export const reqGetAllGoodCates = () => {
    //发请求:axios发请求返回结果Promise对象
    return request({ url: '/api/getAllGoodCates', method: 'get' }) 
}